<!-- 这是侧边栏 -->
<!-- 未登录 -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
	<meta charset="utf-8">
</head>

<side th:fragments="side"> >
	<div th:if="${session.USER==null}" class="panel panel-default" id="sidebar2"
		style="width: 20%; margin: 1% 2% 1% 0%; float: right">
		<div class="panel-heading" style="background-color: white; text-align: center">
			<blockquote>
				逍遥论坛 <small>一个小论坛</small>
			</blockquote>
		</div>
		<ul class="list-group" style="width: 100%">
			<li class="list-group-item"><a th:href="toLoginPage.do" class="btn btn-primary btn-block">登录</a> <a
					th:href="toSignUpPage.do" class="btn btn-default btn-block">注册</a></li>
		</ul>
	</div>

	<!-- 已登录 -->
	<div class="panel panel-default" id="sidebar2" style="width: 20%;margin:1% 2% 1% 0%;float: right"
		th:if="${session.USER != null}" th:object="${session.USER}">
		<div th:if="${session.USER!=null}" class="panel-heading" style="background-color: white;text-align: center">欢迎您！
			<a th:href="${'getUserInfo.do?userId='+ session.USER.userId }">
				<span th:if="*{userNick == null}" th:text="*{userName}"></span>
				<span th:if="*{userNick != null}" th:text="*{userNick}"></span>
			</a>
			<div><span th:switch="*{userType}">
					<span class="label label-primary" th:case="0">超级管理员</span>
					<span class="label label-primary" th:case="1">管理员</span>
					<span class="label label-primary" th:case="*">普通用户</span>
				</span>
			</div>

		</div>
		<ul class="list-group" style="width: 100%">
			<!-- 被锁定的用户不能发贴 -->
			<li th:if="*{userStatus != 2}" class="list-group-item">
				<a href="toPublishTip.do">发表新贴</a>
			</li>
			<li th:if="*{userType == 0}" class="list-group-item">
				<a href="toSignUpPage.do">注册新的管理员</a>
			</li>
			<li class="list-group-item"><a href="#">待添加</a></li>
		</ul>
	</div>
</side>